<?php
/*
 * name: gsl
 * desc: 平台角色权限关联表 迁移表
 * date: 2018/09/21
 * */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateAdminRolePermissionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_role_permission', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->integer('role_id')->comment('角色id');
            $table->integer('permission_id')->comment('权限id');

            $table->timestamps();
            // $table->softDeletes();
        });
        // 表注释
        DB::statement("ALTER TABLE `".config('database.connections.mysql.prefix')."admin_role_permission` comment'平台角色权限关联表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_role_permission');
    }
}
